package com.lxm.redisson;

import org.redisson.Redisson;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;

import java.util.concurrent.TimeUnit;

public class TestRedisson {
    public static void main(String[] args){
        RedissonClient client = Redisson.create();
        RLock rLock = client.getLock("test_a");
        rLock.lock(20, TimeUnit.SECONDS);
        try {
            System.out.println("1");
        }finally {
            rLock.unlock();
        }
        client.shutdown();
    }
}
